<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<jsp:include page="parts/adminFooter.jsp"></jsp:include>
<!DOCTYPE html>
<html>
	<head>
		<title>欢迎登录后台系统</title>	
		<link rel="stylesheet" href="${ctx}/css/login.css" />
	</head>
	<section id="page_login_index">
			<div id="mainBody">
		      <div id="cloud1" class="cloud"></div>
		      <div id="cloud2" class="cloud"></div>
	    	</div>
	    	<div class="logintop_v1">    
			    <span>欢迎登录后台管理界面平台</span>    
			    <ul>
				    <li><a href="#">回首页</a></li>
				    <li><a href="#">帮助</a></li>
				    <li><a href="#">关于</a></li>
			    </ul>    
			</div>
			<div class="loginbody_v1">
				<span class="systemlogo_v1"></span>
				<form  id="loginForm">
					<div class="loginbox_v1">
						<ul>
							<li>
								<input type="text" class="loginuser_v1" value="admin" name="loginName">
							</li>
							<li>
								<input type="password" class="loginpwd_v1" value="123456" >
							</li>
							<li>
								<input type="text" maxlength="4" class="logincode_v1">
							</li>
							<li>
								<input type="button" class="loginbtn" value="登录" onclick="login()">
							</li>
						</ul>
					</div>
				</form>
			</div>
	</section>
	<script type="text/javascript">
		var login = function(){
			var param ={
					loginName:document.getElementsByClassName("loginuser_v1")[0].value,
					password:document.getElementsByClassName("loginpwd_v1")[0].value
			};
			progressLoad_v1();
			$.ajax({
				type:'post',
				url:'${ctx}/loginAction',
				data:param,
				dataType:'json',
				success:function(result){
					progressClose_v1();
					//页面重定向
					if(result.sus){
						window.location.href="${ctx}/menu/getMenuPage";
					}else{
						window.location.href="${ctx}/common/gerErrorPage";
					}
				},
				error:function(result){
					window.location.href="${ctx}/common/gerErrorPage";
				}
			});
		}
	</script>
</html>













